package com.hyy.blogtest.common.pojo.request;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
public class UserLoginRequest {

    //参数校验来源于spring boot validation依赖
    //不满足校验抛出异常：MethodArgumentNotValidException
    @NotNull
    @NotBlank(message = "用户名不能为空")
    @Length(max = 20, message = "用户名不能大于20个字")
    private String username;

    @NotNull
    @NotBlank(message = "密码不能为空")
    @Length(min=1,message = "密码不能小于一个字符")
    private String password;
}

